//
//  EXPredicate.h
//  ORM
//
//  Created by PH on 29.12.09.
//  Copyright 2009-2010 Codesign. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "EXMappableObject.h"

@class EXObjectStore;

@interface EXPredicate : NSObject {
	Class cls;
	EXObjectStore* objectStore;
	NSMutableArray* condBlocks;
	BOOL(^filterBlock)(id);
}

@property (nonatomic, copy) BOOL(^filterBlock)(id);

- (id)initWithClass:(Class)_cls objectStore:(EXObjectStore*)_objectStore;
+ (EXPredicate*)predicateWithClass:(Class)_cls objectStore:(EXObjectStore*)_objectStore;
- (void(^)(void*))condBlock;
- (Class)predicateClass;
- (EXPredicate*)restrictField:(NSString*)fieldName equalsString:(NSString*)value;
- (EXPredicate*)restrictField:(NSString*)fieldName equalsObject:(NSObject<EXMappableObject>*)value;
- (EXPredicate*)restrictField:(NSString*)fieldName containsString:(NSString*)value;
- (EXPredicate*)restrictField:(NSString*)fieldName lessThanNumber:(double)value;
- (EXPredicate*)restrictField:(NSString*)fieldName greaterThanNumber:(double)value;
- (EXPredicate*)restrictField:(NSString*)fieldName equalsNumber:(double)value;

@end
